pictureBox.BackgroundImageLayout = ImageLayout.Zoom; image = new Bitmap(width, height); Graphics g = Graphics.FromImage(image); g.CopyFromScreen(x, y, 0, 0, new System.Drawing.Size(width, height)); if (width < pictureBox.Width && height < pictureBox.Height) pictureBox.BackgroundImageLayout = ImageLayout.Center; pictureBox.BackgroundImage = image;
评论